<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>

  <body>
    <ul>
      <li>子项1</li>
      <li>子项2</li>
      <li>子项3</li>
      <li>子项4</li>
      <li>子项5</li>
      <li>子项6</li>
    </ul>

    <hr />

    <button id="d1">解绑事件</button>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

    <script>
      function handler() {
        console.log($(this).html())
      }

      $('ul').on('click', 'li', handler)

      /*
      在 deme .on 的基础上，
      点击按钮后，解绑掉 li 的事件注册
      */
      $('#d1').on('click', function () {
        console.log('解绑事件？')
        $('ul').off('click')
      })
    </script>
  </body>
</html>
